var t = require("../../@babel/runtime/helpers/defineProperty"),
  a = require("../../res/www.a9a.cn.js"),
  i = getApp();
Page({
  data: {
    nTitle: "推广奖励・说明",
    btm_nav: "help",
    btmnavbg_color: "#B8BCCC",
    btmnavbg_rgbcolor: a.c16_rgb("#B8BCCC"),
    triggered: !0,
  },
  onLoad: function (t) {
    var e = this,
      n = 0,
      r = 0;
    wx.setNavigationBarTitle({ title: e.data.nTitle }),
      i.get_config("_ZEAI").then(function (t) {
        e.setData({ color: i._ZEAI.color, rgbcolor: a.c16_rgb(i._ZEAI.color) });
      }),
      i.get_navigationBarTopHeight(e),
      (a.ifint(t.tguid) || a.ifint(t.admid)) &&
        ((n = a.ifint(t.tguid) ? t.tguid : 0),
        (r = a.ifint(t.admid) ? t.admid : 0)),
      e.setData({ tguid: n, admid: r }),
      this.init();
  },
  init: function (t, e) {
    var n = this;
    wx.showLoading({ title: "玩命加载中...", mask: !0 }), !1;
    var r = {
      submitok: "HELP",
      openid: wx.getStorageSync("COOK_U").openid,
      tguid: n.data.tguid,
      admid: n.data.admid,
    };
    i.ajax({
      url: "tg.php",
      data: r,
      success: function (t) {
        switch ((wx.hideLoading(), n.setData({ flag: t.flag }), t.flag)) {
          case "1":
          case 1:
            wx.setNavigationBarTitle({ title: t.nTitle }),
              n.setData({
                nTitle: t.nTitle,
                btm_nav_msg_num: t.btm_nav_msg_num,
                D: t.D,
                SHARE: t.SHARE,
              });
            break;
          case "flag0":
          case "flag_1":
          case "flag2":
            wx.reLaunch({ url: "reg?t=" + t.flag });
            break;
          default:
            (t.this = n), (t.url = "no"), a.sorry(t);
        }
      },
    });
  },
  onPullDownRefresh: function () {
    var t = this;
    wx.vibrateShort({ type: "heavy" }),
      setTimeout(function () {
        t.setData({ triggered: !1 }), t.init();
      }, 500);
  },
  binnd_scroll: function (t) {
    t.detail.scrollTop > 100
      ? this.setData({ backtop_flag: !0 })
      : this.setData({ backtop_flag: !1 });
  },
  backtopFn: function (a) {
    var i = "scrolltopNum_" + a.currentTarget.dataset.id;
    this.setData(t({}, i, 0));
  },
  onShareAppMessage: function (t) {
    return {
      imageUrl: this.data.SHARE.imgurl,
      title: this.data.SHARE.title,
      path: "/pages/tg/help",
    };
  },
  onShareTimeline: function () {
    return {
      imageUrl: this.data.SHARE.imgurl,
      title: this.data.SHARE.title,
      query: "",
      path: "/pages/tg/help",
    };
  },
});
